@import '../../styles/variables';
@import '../../styles/mixins';

:global {
  .App {
    position: relative;
  }

  // Element that wraps everything except for the header
  .App-wrapper {
    margin: 0 auto;
    max-width: $App-maximumWidth;
    position: relative;
  }

  .App-mobileNavMenu {
    height: 34px;
    background-color: $ms-color-white;
    border-bottom: 1px solid $ms-color-neutralTertiary;
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    z-index: 999;
  }

  // Nav is hidden off screen by default
  .App-nav {
    -webkit-overflow-scrolling: touch; // Improves scrolling performance
    overflow-y: auto;
    max-height: 100vh;
    height: 100vh; // fallback height if not set in JS style attribute
    width: $Nav-width;
    @include ms-float(left);
    z-index: 999; // This z-index needs to be high to prevent jittery scrolling in Edge.
  }

  .ms-App-navPanel {
    top: 50px;

    .ms-Panel-main {
      background-color: $ms-color-neutralDark;
      border-color: $ms-color-neutralDark;
    }
  }

  .App-content {
    @include contentPadding();
    background-color: $ms-color-neutralLighter;
    left: 0;
    overflow: hidden;
    position: relative;
    transition: all $ms-animation-duration-2 $ms-animation-ease-1;
    min-height: calc(100vh - #{$Header-height-full-uhf});

    @include high-contrast {
      border-right: 1px solid WindowText;
      border-left: 1px solid WindowText;
      border-bottom: 1px solid WindowText;
    }
  }

  // Show the nav at all times, to the left of the content
  @media screen and (min-width: $uhf-screen-min-mobile) {
    .App {
      background-color: $ms-color-neutralDark;
      justify-content: center;
      @include ms-padding-right($App-padding-right-lg);
      @include ms-padding-left($App-padding-left-lg);
    }

    .App-nav {
      top: 0;
      bottom: 0;
      overflow-y: auto;
      overflow-x: hidden;
    }

    .App-content {
      max-width: calc(100% - #{$Nav-width}); // IE needs max-width, it was ignoring width
      width: calc(100% - #{$Nav-width});
      @include ms-left($Nav-width);
    }
  }

  @media only screen and (max-width: $uhf-screen-max-lg) and (min-width: $uhf-screen-min-mobile) {
    .App {
      @include ms-padding-right($App-padding-right-sm);
      @include ms-padding-left($App-padding-left-sm);
    }

    .App-nav {
      @include ms-margin-left(18px);
    }

    .App-content {
      width: calc(100% - #{$Nav-width});
      @include ms-left($Nav-width + 18px);
    }
  }

  @media only screen and (max-width: $uhf-screen-min-mobile) {
    .App {
      padding: 0;
    }

    .App-mobileNavMenu {
      display: flex;
      align-items: center;
      padding: 0 8px;
    }

    .ms-App-fluentMessageBar {
      display: none;
    }
  }
}
